Python project template - black and isort
using black and isort
Table of Content
VSCode settings#
settings.json
{
"editor.formatOnSave": true,
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"python.formatting.provider": "black",
}
black and isort args/settings#
pyproject.toml
[tool.black]
line-length = 99 # override black's default line-length
exclude = '''
/(
\.git
| \.mypy_cache
| \.tox
| venv
| \.venv
| _build
| buck-out
| build
| dist
)/
'''
[tool.isort]
# make it compatible with black
profile = "black"